\(\int \frac {x (a+b \arctan (c x))^2}{(d+e x^2)^2} \, dx\) [1270]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [B] (verified)
   Fricas [F]
   Sympy [F(-1)]
   Maxima [F(-2)]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 21, antiderivative size = 457 \[ \int \frac {x (a+b \arctan (c x))^2}{\left (d+e x^2\right )^2} \, dx=\frac {c^2 (a+b \arctan (c x))^2}{2 \left (c^2 d-e\right ) e}-\frac {(a+b \arctan (c x))^2}{4 d e \left (1-\frac {\sqrt {e} x}{\sqrt {-d}}\right )}-\frac {(a+b \arctan (c x))^2}{4 d e \left (1+\frac {\sqrt {e} x}{\sqrt {-d}}\right )}-\frac {b c (a+b \arctan (c x)) \log \left (\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{\left (c \sqrt {-d}-i \sqrt {e}\right ) (1-i c x)}\right )}{2 \sqrt {-d} \left (c^2 d-e\right ) \sqrt {e}}+\frac {b c (a+b \arctan (c x)) \log \left (\frac {2 c \left (\sqrt {-d}+\sqrt {e} x\right )}{\left (c \sqrt {-d}+i \sqrt {e}\right ) (1-i c x)}\right )}{2 \sqrt {-d} \left (c^2 d-e\right ) \sqrt {e}}+\frac {i b^2 c \operatorname {PolyLog}\left (2,1-\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{\left (c \sqrt {-d}-i \sqrt {e}\right ) (1-i c x)}\right )}{4 \sqrt {-d} \left (c^2 d-e\right ) \sqrt {e}}-\frac {i b^2 c \operatorname {PolyLog}\left (2,1-\frac {2 c \left (\sqrt {-d}+\sqrt {e} x\right )}{\left (c \sqrt {-d}+i \sqrt {e}\right ) (1-i c x)}\right )}{4 \sqrt {-d} \left (c^2 d-e\right ) \sqrt {e}} \]

[Out]

1/2*c^2*(a+b*arctan(c*x))^2/(c^2*d-e)/e-1/2*b*c*(a+b*arctan(c*x))*ln(2*c*((-d)^(1/2)-x*e^(1/2))/(1-I*c*x)/(c*(
-d)^(1/2)-I*e^(1/2)))/(c^2*d-e)/(-d)^(1/2)/e^(1/2)+1/2*b*c*(a+b*arctan(c*x))*ln(2*c*((-d)^(1/2)+x*e^(1/2))/(1-
I*c*x)/(c*(-d)^(1/2)+I*e^(1/2)))/(c^2*d-e)/(-d)^(1/2)/e^(1/2)+1/4*I*b^2*c*polylog(2,1-2*c*((-d)^(1/2)-x*e^(1/2
))/(1-I*c*x)/(c*(-d)^(1/2)-I*e^(1/2)))/(c^2*d-e)/(-d)^(1/2)/e^(1/2)-1/4*I*b^2*c*polylog(2,1-2*c*((-d)^(1/2)+x*
e^(1/2))/(1-I*c*x)/(c*(-d)^(1/2)+I*e^(1/2)))/(c^2*d-e)/(-d)^(1/2)/e^(1/2)-1/4*(a+b*arctan(c*x))^2/d/e/(1-x*e^(
1/2)/(-d)^(1/2))-1/4*(a+b*arctan(c*x))^2/d/e/(1+x*e^(1/2)/(-d)^(1/2))

Rubi [A] (verified)

Time = 0.76 (sec) , antiderivative size = 457, normalized size of antiderivative = 1.00, number of steps used = 27, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.476, Rules used = {5098, 4974, 4966, 2449, 2352, 2497, 5104, 5004, 5040, 4964} \[ \int \frac {x (a+b \arctan (c x))^2}{\left (d+e x^2\right )^2} \, dx=\frac {c^2 (a+b \arctan (c x))^2}{2 e \left (c^2 d-e\right )}-\frac {b c (a+b \arctan (c x)) \log \left (\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{(1-i c x) \left (c \sqrt {-d}-i \sqrt {e}\right )}\right )}{2 \sqrt {-d} \sqrt {e} \left (c^2 d-e\right )}+\frac {b c (a+b \arctan (c x)) \log \left (\frac {2 c \left (\sqrt {-d}+\sqrt {e} x\right )}{(1-i c x) \left (c \sqrt {-d}+i \sqrt {e}\right )}\right )}{2 \sqrt {-d} \sqrt {e} \left (c^2 d-e\right )}-\frac {(a+b \arctan (c x))^2}{4 d e \left (1-\frac {\sqrt {e} x}{\sqrt {-d}}\right )}-\frac {(a+b \arctan (c x))^2}{4 d e \left (\frac {\sqrt {e} x}{\sqrt {-d}}+1\right )}+\frac {i b^2 c \operatorname {PolyLog}\left (2,1-\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{\left (c \sqrt {-d}-i \sqrt {e}\right ) (1-i c x)}\right )}{4 \sqrt {-d} \sqrt {e} \left (c^2 d-e\right )}-\frac {i b^2 c \operatorname {PolyLog}\left (2,1-\frac {2 c \left (\sqrt {e} x+\sqrt {-d}\right )}{\left (\sqrt {-d} c+i \sqrt {e}\right ) (1-i c x)}\right )}{4 \sqrt {-d} \sqrt {e} \left (c^2 d-e\right )} \]

[In]

Int[(x*(a + b*ArcTan[c*x])^2)/(d + e*x^2)^2,x]

[Out]

(c^2*(a + b*ArcTan[c*x])^2)/(2*(c^2*d - e)*e) - (a + b*ArcTan[c*x])^2/(4*d*e*(1 - (Sqrt[e]*x)/Sqrt[-d])) - (a
+ b*ArcTan[c*x])^2/(4*d*e*(1 + (Sqrt[e]*x)/Sqrt[-d])) - (b*c*(a + b*ArcTan[c*x])*Log[(2*c*(Sqrt[-d] - Sqrt[e]*
x))/((c*Sqrt[-d] - I*Sqrt[e])*(1 - I*c*x))])/(2*Sqrt[-d]*(c^2*d - e)*Sqrt[e]) + (b*c*(a + b*ArcTan[c*x])*Log[(
2*c*(Sqrt[-d] + Sqrt[e]*x))/((c*Sqrt[-d] + I*Sqrt[e])*(1 - I*c*x))])/(2*Sqrt[-d]*(c^2*d - e)*Sqrt[e]) + ((I/4)
*b^2*c*PolyLog[2, 1 - (2*c*(Sqrt[-d] - Sqrt[e]*x))/((c*Sqrt[-d] - I*Sqrt[e])*(1 - I*c*x))])/(Sqrt[-d]*(c^2*d -
 e)*Sqrt[e]) - ((I/4)*b^2*c*PolyLog[2, 1 - (2*c*(Sqrt[-d] + Sqrt[e]*x))/((c*Sqrt[-d] + I*Sqrt[e])*(1 - I*c*x))
])/(Sqrt[-d]*(c^2*d - e)*Sqrt[e])

Rule 2352

Int[Log[(c_.)*(x_)]/((d_) + (e_.)*(x_)), x_Symbol] :> Simp[(-e^(-1))*PolyLog[2, 1 - c*x], x] /; FreeQ[{c, d, e
}, x] && EqQ[e + c*d, 0]

Rule 2449

Int[Log[(c_.)/((d_) + (e_.)*(x_))]/((f_) + (g_.)*(x_)^2), x_Symbol] :> Dist[-e/g, Subst[Int[Log[2*d*x]/(1 - 2*
d*x), x], x, 1/(d + e*x)], x] /; FreeQ[{c, d, e, f, g}, x] && EqQ[c, 2*d] && EqQ[e^2*f + d^2*g, 0]

Rule 2497

Int[Log[u_]*(Pq_)^(m_.), x_Symbol] :> With[{C = FullSimplify[Pq^m*((1 - u)/D[u, x])]}, Simp[C*PolyLog[2, 1 - u
], x] /; FreeQ[C, x]] /; IntegerQ[m] && PolyQ[Pq, x] && RationalFunctionQ[u, x] && LeQ[RationalFunctionExponen
ts[u, x][[2]], Expon[Pq, x]]

Rule 4964

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)/((d_) + (e_.)*(x_)), x_Symbol] :> Simp[(-(a + b*ArcTan[c*x])^p)*(
Log[2/(1 + e*(x/d))]/e), x] + Dist[b*c*(p/e), Int[(a + b*ArcTan[c*x])^(p - 1)*(Log[2/(1 + e*(x/d))]/(1 + c^2*x
^2)), x], x] /; FreeQ[{a, b, c, d, e}, x] && IGtQ[p, 0] && EqQ[c^2*d^2 + e^2, 0]

Rule 4966

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))/((d_) + (e_.)*(x_)), x_Symbol] :> Simp[(-(a + b*ArcTan[c*x]))*(Log[2/(1
 - I*c*x)]/e), x] + (Dist[b*(c/e), Int[Log[2/(1 - I*c*x)]/(1 + c^2*x^2), x], x] - Dist[b*(c/e), Int[Log[2*c*((
d + e*x)/((c*d + I*e)*(1 - I*c*x)))]/(1 + c^2*x^2), x], x] + Simp[(a + b*ArcTan[c*x])*(Log[2*c*((d + e*x)/((c*
d + I*e)*(1 - I*c*x)))]/e), x]) /; FreeQ[{a, b, c, d, e}, x] && NeQ[c^2*d^2 + e^2, 0]

Rule 4974

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_)*((d_) + (e_.)*(x_))^(q_.), x_Symbol] :> Simp[(d + e*x)^(q + 1)*((a
 + b*ArcTan[c*x])^p/(e*(q + 1))), x] - Dist[b*c*(p/(e*(q + 1))), Int[ExpandIntegrand[(a + b*ArcTan[c*x])^(p -
1), (d + e*x)^(q + 1)/(1 + c^2*x^2), x], x], x] /; FreeQ[{a, b, c, d, e}, x] && IGtQ[p, 1] && IntegerQ[q] && N
eQ[q, -1]

Rule 5004

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)/((d_) + (e_.)*(x_)^2), x_Symbol] :> Simp[(a + b*ArcTan[c*x])^(p +
 1)/(b*c*d*(p + 1)), x] /; FreeQ[{a, b, c, d, e, p}, x] && EqQ[e, c^2*d] && NeQ[p, -1]

Rule 5040

Int[(((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)*(x_))/((d_) + (e_.)*(x_)^2), x_Symbol] :> Simp[(-I)*((a + b*ArcT
an[c*x])^(p + 1)/(b*e*(p + 1))), x] - Dist[1/(c*d), Int[(a + b*ArcTan[c*x])^p/(I - c*x), x], x] /; FreeQ[{a, b
, c, d, e}, x] && EqQ[e, c^2*d] && IGtQ[p, 0]

Rule 5098

Int[(((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)*(x_))/((d_) + (e_.)*(x_)^2)^2, x_Symbol] :> Dist[1/(4*d^2*Rt[-e/
d, 2]), Int[(a + b*ArcTan[c*x])^p/(1 - Rt[-e/d, 2]*x)^2, x], x] - Dist[1/(4*d^2*Rt[-e/d, 2]), Int[(a + b*ArcTa
n[c*x])^p/(1 + Rt[-e/d, 2]*x)^2, x], x] /; FreeQ[{a, b, c, d, e}, x] && IGtQ[p, 0]

Rule 5104

Int[(((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)*((f_) + (g_.)*(x_))^(m_.))/((d_) + (e_.)*(x_)^2), x_Symbol] :> I
nt[ExpandIntegrand[(a + b*ArcTan[c*x])^p/(d + e*x^2), (f + g*x)^m, x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] &
& IGtQ[p, 0] && EqQ[e, c^2*d] && IGtQ[m, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {\int \frac {(a+b \arctan (c x))^2}{\left (1-\frac {\sqrt {e} x}{\sqrt {-d}}\right )^2} \, dx}{4 (-d)^{3/2} \sqrt {e}}-\frac {\int \frac {(a+b \arctan (c x))^2}{\left (1+\frac {\sqrt {e} x}{\sqrt {-d}}\right )^2} \, dx}{4 (-d)^{3/2} \sqrt {e}} \\ & = -\frac {(a+b \arctan (c x))^2}{4 d e \left (1-\frac {\sqrt {e} x}{\sqrt {-d}}\right )}-\frac {(a+b \arctan (c x))^2}{4 d e \left (1+\frac {\sqrt {e} x}{\sqrt {-d}}\right )}+\frac {(b c) \int \left (\frac {\sqrt {-d} e (a+b \arctan (c x))}{\left (c^2 d-e\right ) \left (-\sqrt {-d}+\sqrt {e} x\right )}+\frac {c^2 d \left (\sqrt {-d}+\sqrt {e} x\right ) (a+b \arctan (c x))}{\sqrt {-d} \left (c^2 d-e\right ) \left (1+c^2 x^2\right )}\right ) \, dx}{2 d e}+\frac {(b c) \int \left (\frac {\sqrt {-d} e (a+b \arctan (c x))}{\left (-c^2 d+e\right ) \left (\sqrt {-d}+\sqrt {e} x\right )}+\frac {c^2 \left (d+\sqrt {-d} \sqrt {e} x\right ) (a+b \arctan (c x))}{\left (c^2 d-e\right ) \left (1+c^2 x^2\right )}\right ) \, dx}{2 d e} \\ & = -\frac {(a+b \arctan (c x))^2}{4 d e \left (1-\frac {\sqrt {e} x}{\sqrt {-d}}\right )}-\frac {(a+b \arctan (c x))^2}{4 d e \left (1+\frac {\sqrt {e} x}{\sqrt {-d}}\right )}-\frac {(b c) \int \frac {a+b \arctan (c x)}{-\sqrt {-d}+\sqrt {e} x} \, dx}{2 \sqrt {-d} \left (c^2 d-e\right )}+\frac {(b c) \int \frac {a+b \arctan (c x)}{\sqrt {-d}+\sqrt {e} x} \, dx}{2 \sqrt {-d} \left (c^2 d-e\right )}+\frac {\left (b c^3\right ) \int \frac {\left (\sqrt {-d}+\sqrt {e} x\right ) (a+b \arctan (c x))}{1+c^2 x^2} \, dx}{2 \sqrt {-d} \left (c^2 d-e\right ) e}+\frac {\left (b c^3\right ) \int \frac {\left (d+\sqrt {-d} \sqrt {e} x\right ) (a+b \arctan (c x))}{1+c^2 x^2} \, dx}{2 d \left (c^2 d-e\right ) e} \\ & = -\frac {(a+b \arctan (c x))^2}{4 d e \left (1-\frac {\sqrt {e} x}{\sqrt {-d}}\right )}-\frac {(a+b \arctan (c x))^2}{4 d e \left (1+\frac {\sqrt {e} x}{\sqrt {-d}}\right )}-\frac {b c (a+b \arctan (c x)) \log \left (\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{\left (c \sqrt {-d}-i \sqrt {e}\right ) (1-i c x)}\right )}{2 \sqrt {-d} \left (c^2 d-e\right ) \sqrt {e}}+\frac {b c (a+b \arctan (c x)) \log \left (\frac {2 c \left (\sqrt {-d}+\sqrt {e} x\right )}{\left (c \sqrt {-d}+i \sqrt {e}\right ) (1-i c x)}\right )}{2 \sqrt {-d} \left (c^2 d-e\right ) \sqrt {e}}+\frac {\left (b c^3\right ) \int \left (\frac {\sqrt {-d} (a+b \arctan (c x))}{1+c^2 x^2}+\frac {\sqrt {e} x (a+b \arctan (c x))}{1+c^2 x^2}\right ) \, dx}{2 \sqrt {-d} \left (c^2 d-e\right ) e}+\frac {\left (b c^3\right ) \int \left (\frac {d (a+b \arctan (c x))}{1+c^2 x^2}+\frac {\sqrt {-d} \sqrt {e} x (a+b \arctan (c x))}{1+c^2 x^2}\right ) \, dx}{2 d \left (c^2 d-e\right ) e}+\frac {\left (b^2 c^2\right ) \int \frac {\log \left (\frac {2 c \left (-\sqrt {-d}+\sqrt {e} x\right )}{\left (-c \sqrt {-d}+i \sqrt {e}\right ) (1-i c x)}\right )}{1+c^2 x^2} \, dx}{2 \sqrt {-d} \left (c^2 d-e\right ) \sqrt {e}}-\frac {\left (b^2 c^2\right ) \int \frac {\log \left (\frac {2 c \left (\sqrt {-d}+\sqrt {e} x\right )}{\left (c \sqrt {-d}+i \sqrt {e}\right ) (1-i c x)}\right )}{1+c^2 x^2} \, dx}{2 \sqrt {-d} \left (c^2 d-e\right ) \sqrt {e}} \\ & = -\frac {(a+b \arctan (c x))^2}{4 d e \left (1-\frac {\sqrt {e} x}{\sqrt {-d}}\right )}-\frac {(a+b \arctan (c x))^2}{4 d e \left (1+\frac {\sqrt {e} x}{\sqrt {-d}}\right )}-\frac {b c (a+b \arctan (c x)) \log \left (\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{\left (c \sqrt {-d}-i \sqrt {e}\right ) (1-i c x)}\right )}{2 \sqrt {-d} \left (c^2 d-e\right ) \sqrt {e}}+\frac {b c (a+b \arctan (c x)) \log \left (\frac {2 c \left (\sqrt {-d}+\sqrt {e} x\right )}{\left (c \sqrt {-d}+i \sqrt {e}\right ) (1-i c x)}\right )}{2 \sqrt {-d} \left (c^2 d-e\right ) \sqrt {e}}+\frac {i b^2 c \operatorname {PolyLog}\left (2,1-\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{\left (c \sqrt {-d}-i \sqrt {e}\right ) (1-i c x)}\right )}{4 \sqrt {-d} \left (c^2 d-e\right ) \sqrt {e}}-\frac {i b^2 c \operatorname {PolyLog}\left (2,1-\frac {2 c \left (\sqrt {-d}+\sqrt {e} x\right )}{\left (c \sqrt {-d}+i \sqrt {e}\right ) (1-i c x)}\right )}{4 \sqrt {-d} \left (c^2 d-e\right ) \sqrt {e}}+2 \frac {\left (b c^3\right ) \int \frac {a+b \arctan (c x)}{1+c^2 x^2} \, dx}{2 \left (c^2 d-e\right ) e} \\ & = \frac {c^2 (a+b \arctan (c x))^2}{2 \left (c^2 d-e\right ) e}-\frac {(a+b \arctan (c x))^2}{4 d e \left (1-\frac {\sqrt {e} x}{\sqrt {-d}}\right )}-\frac {(a+b \arctan (c x))^2}{4 d e \left (1+\frac {\sqrt {e} x}{\sqrt {-d}}\right )}-\frac {b c (a+b \arctan (c x)) \log \left (\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{\left (c \sqrt {-d}-i \sqrt {e}\right ) (1-i c x)}\right )}{2 \sqrt {-d} \left (c^2 d-e\right ) \sqrt {e}}+\frac {b c (a+b \arctan (c x)) \log \left (\frac {2 c \left (\sqrt {-d}+\sqrt {e} x\right )}{\left (c \sqrt {-d}+i \sqrt {e}\right ) (1-i c x)}\right )}{2 \sqrt {-d} \left (c^2 d-e\right ) \sqrt {e}}+\frac {i b^2 c \operatorname {PolyLog}\left (2,1-\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{\left (c \sqrt {-d}-i \sqrt {e}\right ) (1-i c x)}\right )}{4 \sqrt {-d} \left (c^2 d-e\right ) \sqrt {e}}-\frac {i b^2 c \operatorname {PolyLog}\left (2,1-\frac {2 c \left (\sqrt {-d}+\sqrt {e} x\right )}{\left (c \sqrt {-d}+i \sqrt {e}\right ) (1-i c x)}\right )}{4 \sqrt {-d} \left (c^2 d-e\right ) \sqrt {e}} \\ \end{align*}

Mathematica [A] (verified)

Time = 6.93 (sec) , antiderivative size = 836, normalized size of antiderivative = 1.83 \[ \int \frac {x (a+b \arctan (c x))^2}{\left (d+e x^2\right )^2} \, dx=\frac {1}{4} \left (-\frac {2 a^2}{e \left (d+e x^2\right )}+\frac {4 a b \left (-\frac {\left (1+c^2 x^2\right ) \arctan (c x)}{d+e x^2}+\frac {c \arctan \left (\frac {\sqrt {e} x}{\sqrt {d}}\right )}{\sqrt {d} \sqrt {e}}\right )}{-c^2 d+e}+\frac {b^2 c^2 \left (\frac {4 \arctan (c x)^2}{c^2 d+e+\left (c^2 d-e\right ) \cos (2 \arctan (c x))}+\frac {-4 \arctan (c x) \text {arctanh}\left (\frac {c d}{\sqrt {-c^2 d e} x}\right )-2 \arccos \left (-\frac {c^2 d+e}{c^2 d-e}\right ) \text {arctanh}\left (\frac {c e x}{\sqrt {-c^2 d e}}\right )+\left (\arccos \left (-\frac {c^2 d+e}{c^2 d-e}\right )+2 i \text {arctanh}\left (\frac {c e x}{\sqrt {-c^2 d e}}\right )\right ) \log \left (\frac {2 c d \left (-i e+\sqrt {-c^2 d e}\right ) (-i+c x)}{\left (c^2 d-e\right ) \left (c d+\sqrt {-c^2 d e} x\right )}\right )+\left (\arccos \left (-\frac {c^2 d+e}{c^2 d-e}\right )-2 i \text {arctanh}\left (\frac {c e x}{\sqrt {-c^2 d e}}\right )\right ) \log \left (\frac {2 c d \left (i e+\sqrt {-c^2 d e}\right ) (i+c x)}{\left (c^2 d-e\right ) \left (c d+\sqrt {-c^2 d e} x\right )}\right )-\left (\arccos \left (-\frac {c^2 d+e}{c^2 d-e}\right )-2 i \left (\text {arctanh}\left (\frac {c d}{\sqrt {-c^2 d e} x}\right )+\text {arctanh}\left (\frac {c e x}{\sqrt {-c^2 d e}}\right )\right )\right ) \log \left (\frac {\sqrt {2} \sqrt {-c^2 d e} e^{-i \arctan (c x)}}{\sqrt {c^2 d-e} \sqrt {c^2 d+e+\left (c^2 d-e\right ) \cos (2 \arctan (c x))}}\right )-\left (\arccos \left (-\frac {c^2 d+e}{c^2 d-e}\right )+2 i \left (\text {arctanh}\left (\frac {c d}{\sqrt {-c^2 d e} x}\right )+\text {arctanh}\left (\frac {c e x}{\sqrt {-c^2 d e}}\right )\right )\right ) \log \left (\frac {\sqrt {2} \sqrt {-c^2 d e} e^{i \arctan (c x)}}{\sqrt {c^2 d-e} \sqrt {c^2 d+e+\left (c^2 d-e\right ) \cos (2 \arctan (c x))}}\right )-i \left (\operatorname {PolyLog}\left (2,\frac {\left (c^2 d+e-2 i \sqrt {-c^2 d e}\right ) \left (c d-\sqrt {-c^2 d e} x\right )}{\left (c^2 d-e\right ) \left (c d+\sqrt {-c^2 d e} x\right )}\right )-\operatorname {PolyLog}\left (2,\frac {\left (c^2 d+e+2 i \sqrt {-c^2 d e}\right ) \left (c d-\sqrt {-c^2 d e} x\right )}{\left (c^2 d-e\right ) \left (c d+\sqrt {-c^2 d e} x\right )}\right )\right )}{\sqrt {-c^2 d e}}\right )}{c^2 d-e}\right ) \]

[In]

Integrate[(x*(a + b*ArcTan[c*x])^2)/(d + e*x^2)^2,x]

[Out]

((-2*a^2)/(e*(d + e*x^2)) + (4*a*b*(-(((1 + c^2*x^2)*ArcTan[c*x])/(d + e*x^2)) + (c*ArcTan[(Sqrt[e]*x)/Sqrt[d]
])/(Sqrt[d]*Sqrt[e])))/(-(c^2*d) + e) + (b^2*c^2*((4*ArcTan[c*x]^2)/(c^2*d + e + (c^2*d - e)*Cos[2*ArcTan[c*x]
]) + (-4*ArcTan[c*x]*ArcTanh[(c*d)/(Sqrt[-(c^2*d*e)]*x)] - 2*ArcCos[-((c^2*d + e)/(c^2*d - e))]*ArcTanh[(c*e*x
)/Sqrt[-(c^2*d*e)]] + (ArcCos[-((c^2*d + e)/(c^2*d - e))] + (2*I)*ArcTanh[(c*e*x)/Sqrt[-(c^2*d*e)]])*Log[(2*c*
d*((-I)*e + Sqrt[-(c^2*d*e)])*(-I + c*x))/((c^2*d - e)*(c*d + Sqrt[-(c^2*d*e)]*x))] + (ArcCos[-((c^2*d + e)/(c
^2*d - e))] - (2*I)*ArcTanh[(c*e*x)/Sqrt[-(c^2*d*e)]])*Log[(2*c*d*(I*e + Sqrt[-(c^2*d*e)])*(I + c*x))/((c^2*d
- e)*(c*d + Sqrt[-(c^2*d*e)]*x))] - (ArcCos[-((c^2*d + e)/(c^2*d - e))] - (2*I)*(ArcTanh[(c*d)/(Sqrt[-(c^2*d*e
)]*x)] + ArcTanh[(c*e*x)/Sqrt[-(c^2*d*e)]]))*Log[(Sqrt[2]*Sqrt[-(c^2*d*e)])/(Sqrt[c^2*d - e]*E^(I*ArcTan[c*x])
*Sqrt[c^2*d + e + (c^2*d - e)*Cos[2*ArcTan[c*x]]])] - (ArcCos[-((c^2*d + e)/(c^2*d - e))] + (2*I)*(ArcTanh[(c*
d)/(Sqrt[-(c^2*d*e)]*x)] + ArcTanh[(c*e*x)/Sqrt[-(c^2*d*e)]]))*Log[(Sqrt[2]*Sqrt[-(c^2*d*e)]*E^(I*ArcTan[c*x])
)/(Sqrt[c^2*d - e]*Sqrt[c^2*d + e + (c^2*d - e)*Cos[2*ArcTan[c*x]]])] - I*(PolyLog[2, ((c^2*d + e - (2*I)*Sqrt
[-(c^2*d*e)])*(c*d - Sqrt[-(c^2*d*e)]*x))/((c^2*d - e)*(c*d + Sqrt[-(c^2*d*e)]*x))] - PolyLog[2, ((c^2*d + e +
 (2*I)*Sqrt[-(c^2*d*e)])*(c*d - Sqrt[-(c^2*d*e)]*x))/((c^2*d - e)*(c*d + Sqrt[-(c^2*d*e)]*x))]))/Sqrt[-(c^2*d*
e)]))/(c^2*d - e))/4

Maple [B] (verified)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 1174 vs. \(2 (377 ) = 754\).

Time = 2.58 (sec) , antiderivative size = 1175, normalized size of antiderivative = 2.57

method result size
parts \(\text {Expression too large to display}\) \(1175\)
derivativedivides \(\text {Expression too large to display}\) \(1209\)
default \(\text {Expression too large to display}\) \(1209\)

[In]

int(x*(a+b*arctan(c*x))^2/(e*x^2+d)^2,x,method=_RETURNVERBOSE)

[Out]

-1/2*a^2/e/(e*x^2+d)-1/2*b^2*c^2*arctan(c*x)^2/e/(c^2*e*x^2+c^2*d)+I*b^2*c^2*ln(1-(c^2*d-e)*(1+I*c*x)^2/(c^2*x
^2+1)/(-c^2*d-2*(c^2*d*e)^(1/2)-e))*arctan(c*x)/(c^2*d-e)/(c^4*d^2-2*c^2*d*e+e^2)*(c^2*d*e)^(1/2)-1/2*I*b^2*e*
ln(1-(c^2*d-e)*(1+I*c*x)^2/(c^2*x^2+1)/(-c^2*d-2*(c^2*d*e)^(1/2)-e))*arctan(c*x)/d/(c^2*d-e)/(c^4*d^2-2*c^2*d*
e+e^2)*(c^2*d*e)^(1/2)+1/2*I*b^2/e*(c^2*d*e)^(1/2)/d/(c^2*d-e)*arctan(c*x)*ln(1-(c^2*d-e)*(1+I*c*x)^2/(c^2*x^2
+1)/(-c^2*d+2*(c^2*d*e)^(1/2)-e))-1/2*b^2*c^4/e/(c^2*d-e)/(c^4*d^2-2*c^2*d*e+e^2)*arctan(c*x)^2*(c^2*d*e)^(1/2
)*d-1/4*b^2*c^4/e/(c^2*d-e)/(c^4*d^2-2*c^2*d*e+e^2)*polylog(2,(c^2*d-e)*(1+I*c*x)^2/(c^2*x^2+1)/(-c^2*d-2*(c^2
*d*e)^(1/2)-e))*(c^2*d*e)^(1/2)*d-1/2*I*b^2*c^4/e*ln(1-(c^2*d-e)*(1+I*c*x)^2/(c^2*x^2+1)/(-c^2*d-2*(c^2*d*e)^(
1/2)-e))*arctan(c*x)/(c^2*d-e)/(c^4*d^2-2*c^2*d*e+e^2)*(c^2*d*e)^(1/2)*d-1/2*b^2*e/d/(c^2*d-e)/(c^4*d^2-2*c^2*
d*e+e^2)*arctan(c*x)^2*(c^2*d*e)^(1/2)-1/4*b^2*e/d/(c^2*d-e)/(c^4*d^2-2*c^2*d*e+e^2)*polylog(2,(c^2*d-e)*(1+I*
c*x)^2/(c^2*x^2+1)/(-c^2*d-2*(c^2*d*e)^(1/2)-e))*(c^2*d*e)^(1/2)+1/2*b^2/e*(c^2*d*e)^(1/2)/d/(c^2*d-e)*arctan(
c*x)^2+1/4*b^2/e*(c^2*d*e)^(1/2)/d/(c^2*d-e)*polylog(2,(c^2*d-e)*(1+I*c*x)^2/(c^2*x^2+1)/(-c^2*d+2*(c^2*d*e)^(
1/2)-e))+b^2*c^2/(c^2*d-e)/(c^4*d^2-2*c^2*d*e+e^2)*arctan(c*x)^2*(c^2*d*e)^(1/2)+1/2*b^2*c^2/(c^2*d-e)/(c^4*d^
2-2*c^2*d*e+e^2)*polylog(2,(c^2*d-e)*(1+I*c*x)^2/(c^2*x^2+1)/(-c^2*d-2*(c^2*d*e)^(1/2)-e))*(c^2*d*e)^(1/2)+1/2
*b^2*c^2/e/(c^2*d-e)*arctan(c*x)^2-a*b*c^2*arctan(c*x)/e/(c^2*e*x^2+c^2*d)+a*b*c^2/e/(c^2*d-e)*arctan(c*x)-a*b
*c/(c^2*d-e)/(e*d)^(1/2)*arctan(e*x/(e*d)^(1/2))

Fricas [F]

\[ \int \frac {x (a+b \arctan (c x))^2}{\left (d+e x^2\right )^2} \, dx=\int { \frac {{\left (b \arctan \left (c x\right ) + a\right )}^{2} x}{{\left (e x^{2} + d\right )}^{2}} \,d x } \]

[In]

integrate(x*(a+b*arctan(c*x))^2/(e*x^2+d)^2,x, algorithm="fricas")

[Out]

integral((b^2*x*arctan(c*x)^2 + 2*a*b*x*arctan(c*x) + a^2*x)/(e^2*x^4 + 2*d*e*x^2 + d^2), x)

Sympy [F(-1)]

Timed out. \[ \int \frac {x (a+b \arctan (c x))^2}{\left (d+e x^2\right )^2} \, dx=\text {Timed out} \]

[In]

integrate(x*(a+b*atan(c*x))**2/(e*x**2+d)**2,x)

[Out]

Timed out

Maxima [F(-2)]

Exception generated. \[ \int \frac {x (a+b \arctan (c x))^2}{\left (d+e x^2\right )^2} \, dx=\text {Exception raised: ValueError} \]

[In]

integrate(x*(a+b*arctan(c*x))^2/(e*x^2+d)^2,x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(e>0)', see `assume?` for more
details)Is e

Giac [F]

\[ \int \frac {x (a+b \arctan (c x))^2}{\left (d+e x^2\right )^2} \, dx=\int { \frac {{\left (b \arctan \left (c x\right ) + a\right )}^{2} x}{{\left (e x^{2} + d\right )}^{2}} \,d x } \]

[In]

integrate(x*(a+b*arctan(c*x))^2/(e*x^2+d)^2,x, algorithm="giac")

[Out]

sage0*x

Mupad [F(-1)]

Timed out. \[ \int \frac {x (a+b \arctan (c x))^2}{\left (d+e x^2\right )^2} \, dx=\int \frac {x\,{\left (a+b\,\mathrm {atan}\left (c\,x\right )\right )}^2}{{\left (e\,x^2+d\right )}^2} \,d x \]

[In]

int((x*(a + b*atan(c*x))^2)/(d + e*x^2)^2,x)

[Out]

int((x*(a + b*atan(c*x))^2)/(d + e*x^2)^2, x)